﻿using System;
using System.Runtime.InteropServices;

namespace WinFormsApp_ImitateMouseAndKeyboard
{
    /// <summary>
    /// DC 的摘要说明。
    /// </summary>
    public class DC
    {
        public DC()
        { 
        }
        [DllImport("gdi32.dll", EntryPoint = "CreateDC")]
        public static extern int CreateDC(
             string lpDriverName,
             string lpDeviceName,
             string lpOutput,
             IntPtr lpInitData
             );

        [DllImport("gdi32.dll", EntryPoint = "Rectangle")]
        public static extern int Rectangle(
             int hdc,
             int X1,
             int Y1,
             int X2,
             int Y2
             );
        [System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
        private static extern bool BitBlt(
             IntPtr hdcDest, //目标设备的句柄
             int nXDest,//目标对象的左上角的X坐标
             int nYDest,//目标对象的左上角的X坐标
             int nWidth,//目标对象的矩形的宽度
             int nHeight,//目标对象的矩形的长度
             IntPtr hdcSrc,//源设备的句柄
             int nXSrc,//源对象的左上角的X坐标
             int nYSrc,//源对象的左上角的X坐标
             System.Int32 dwRop//光栅的操作值
             );
    }
}
